package org.example.fronted.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.entity.Goods;

import java.util.List;

@Mapper
public interface GoodMapper extends BaseMapper<Goods> {


    List<Goods> getGoodsByIdList(List<Integer> IdList);

    /**
     * 更新库存
     * @param newStockNum   最新库存
     * @param goodId        商品的id
     */
    void updateStockNum(@Param("newStockNum") Integer newStockNum, @Param("goodId") Integer goodId);

    /**
     * 查询指定商品的库存
     */
    Integer getStockOfSpecifiedGoods(@Param("ids") Integer ids);

}
